package com.floreo.shopping.service;

import com.floreo.shopping.model.ShoppingList;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * @author merzod
 */
public class ShoppingListServiceTest {

    private IShoppingListService service;

    @Before
    public void setUp() throws Exception {
        service = ServiceFactory.getInstance().getShoppingListService();
    }

    @Test
    public void testRegisterShoppingList() throws Exception {
        ShoppingList list1 = new ShoppingList("list1");
        ShoppingList list2 = new ShoppingList("list2");
        service.registerShoppingList(list1);
        service.registerShoppingList(list2);
        Assert.assertEquals(2, service.getShoppingLists().size());
        Assert.assertTrue(service.getShoppingLists().contains(list1));
        Assert.assertTrue(service.getShoppingLists().contains(list2));
    }
}
